<div id="top-panel">
    <div id="panel">
        <ul>
            <li><a href="<?php echo site_url("district"); ?>" class="report_seo">List</a></li>			
        </ul>
    </div>
</div>
<div id="wrapper">
	<div id="content">
		<div id="rightnow">
			<h3 class="reallynow">New Item</h3>
			<div>
				<?php echo validation_errors(); ?>
			</div>
			<?php echo form_open('district/save') ?>
			<input type="hidden" name="id" value="<?php echo isset($district['id']) ? $district['id'] : ''; ?>" />
			<table width="100%">
				<tr>
					<td>City</td>
					<td>
						<select name="city_id" id="city_id" class="input1">
							<?php if(count($city)>0): ?>
							<?php foreach($city as $v): ?>
								<optgroup label="<?php echo $v['name']; ?>">
									<?php if(count($v['city_data'])): ?>
									<?php foreach($v['city_data'] as $i): ?>
										<option value="<?php echo $i['id']; ?>" <?php if(isset($district['city_id']) && $district['city_id']==$i['id']):?> selected="selected" <?php endif; ?>><?php echo $i['city']; ?></option>
									<?php endforeach; ?>
									<?php endif;?>
								</optgroup>								
							<?php endforeach; ?>
							<?php endif; ?>
						</select>
					</td>
				</tr>
				<tr>
					<td>District</td>
					<td><input type="text" name="name" class="input" value="<?php echo isset($district['name']) ? $district['name'] : '';  ?>" /></td>
				</tr>
				
				<tr>
					<td>&nbsp;</td>
					<td><input type="submit" value="Save" >
						<input type="button" value="Cancel" class="btcancel" /></td>
				</tr>
			</table>
		</div>
	</div>
</div>